<template>
    <div id="parent">
        <child01 @getMsg="printMsg"></child01>
        <hr>
        <child02 :msg1="msg"></child02>
    </div>
</template>

<script>
import child01 from "@/components/Child01.vue";
import child02 from "@/components/Child02.vue";

export default {
    data(){
        return{
            msg:''
        }

    },
    name: "Parent",
    components: {child01, child02},
    methods:{
        printMsg(data){
            console.log("父组件接收到的：",data)
            this.msg=data
        }
    }
}
</script>

<style>
#parent{
    width: 70vw;
    margin: 5vw;
}
</style>
